<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored ="false"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>北京市电子行政监察平台-机构管理</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="<%=path%>/css/base.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/frame.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/jquery-tree-1.2.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/jquery_ui/v1.8.13/sortable/jquery-ui-1.8.13.custom.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/jquery.treeview.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/jquery-ui-1.8.11.custom.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
			var path = "<%=path%>";
		</script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-1.6.1.min.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-ui-1.8.13.custom.min.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery_ui/v1.8.13/sortable/jquery-ui-1.8.13.custom.min.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.treeview.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-jtemplates.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.form.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.history.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.metadata.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.validate.fixed.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/config/config.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/util.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/oacore.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/jquery-tree-1.2.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/init.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/accountBook.js"></script>
		<script type="text/javascript">
			var tree;
			var treeData = "<%=request.getAttribute("organizationDTOs")%>";
			//获取联系人json字符串
			var accountBookJsonStr ="<%=((String)request.getAttribute("contactJsonString"))%>";
			
			var BE_UPDATESOURCE_NODE = {};

			function initAccountBook(form, input, data, defaultValues) {
				$(function () {
						var accountBook = new oacore.Widget.AccountBook({
							single: false,
							data: data,
							defaultSelects: defaultValues,
							dataForm: form,
							autoHide: true,
							onHide: function () {
								if($.browser.msie)
									$("._hide").show();
							},
							onShow: function () {
								if($.browser.msie)
									$("._hide").hide();
							},
							host: input,
							//转化id和name
							pretreatment: function (data) {
								//id name
								if(!data.id)
								{
									data.id = data.userInfoId;
									delete data.userInfoId;
								}
								if(!data.name)
								{
									data.name = data.userName;
									delete data.userName;
								}
								return data;
							}
						});
					});
			};
			
			function pushBeUpdateNodeData(list) {
				if(list)
				{
					var size = list.length;
					for(var i=0;i<size;++i)
					{
						var org = list[i];
						BE_UPDATESOURCE_NODE[org.orgId] = org;
					}
				}
			};

			function popBeUpdateNodeData(id) {
				var data = BE_UPDATESOURCE_NODE[id];
				delete BE_UPDATESOURCE_NODE[id];
				return data;
			};

			function getNodeById(id) {
				var found;
				$("span.jqtree-node-content").each(function () {
						if(id == parseInt($(this).attr("id")))
						{
							found = this;
							return false;
						}
					});
				return found;
			};

			function updateAllSource() {
				for(var id in BE_UPDATESOURCE_NODE)
				{
					var beUpdateNode = getNodeById(id);
					if(beUpdateNode)
						$(beUpdateNode).data("source", popBeUpdateNodeData(id));
				}
			};
			
			function moveUp()
			{
				tree.moveUp();
			};

			function moveDown()
			{
				tree.moveDown();
			};

			function delNode()
			{
				updateAllSource();
				var selectedContent = tree.getSelectedContent();
				if(selectedContent)
				{
					oacore.Widget.Dialog.confirm("删除确认", "您确定删除此项吗？", function (){
						var idInfo = selectedContent.id.split("_");
						var params = {};
						var source = $(selectedContent).data("source");
						params[ACTIONS.DEL_ORG.params.ORG_ID] = idInfo[0];
						params[ACTIONS.DEL_ORG.params.VERSION] = source.version;
						params[ACTIONS.DEL_ORG.params.ORG_SHORTNAME] = $(selectedContent).data("source").content;
						$.util.Data.request({
								url: ACTIONS.DEL_ORG.url,
								data: params,
								async: false,
								type: "post",
								success: function (data) {
									pushBeUpdateNodeData(data.organizationDTOs);
									$("#contentArea").empty();
									tree.del();
								}
							});
					});
				}
			};

			function openDetail(nodeId)
			{
				var idInfo = nodeId.split("_");
				var params = {};
				params[ACTIONS.ORG_DETAIL.params.ORG_ID] = idInfo[0];
				params[ACTIONS.ORG_DETAIL.params.VERSION] = idInfo[1];
				$.util.Data.request({
						url: ACTIONS.ORG_DETAIL.url,
						data: params,
						async: false,
						dataType: "json",
						type: "post",
						success: function (data) {
							if(!data.organizationDTO)
								return;
							oacore.UI.render("form/org_detail", data, $("#contentArea"));
						},
						error: function () {
							$("#contentArea").html("获取详细信息失败!");
						}
					});
			};

			function openEdit()
			{
				updateAllSource();
				var selectedContent = tree.getSelectedContent();
				if(!selectedContent)
					return;
				var idInfo = selectedContent.id.split("_");
				var params = {};
				var source = $(selectedContent).data("source");
				params[ACTIONS.ORG_DETAIL.params.ORG_ID] = idInfo[0];
				params[ACTIONS.ORG_DETAIL.params.VERSION] = source.version;
				$.util.Data.request({
						url: ACTIONS.ORG_DETAIL.url,
						data: params,
						async: false,
						dataType: "json",
						type: "post",
						success: function (data) {
							var parent = $("#contentArea");
							data.url = ACTIONS.EDIT_ORG.url;
							data.dataId = idInfo[0];
							oacore.UI.render("form/edit_org", data, parent, function () {
									var form = $("#creatorForm");
									//初始化联系人列表
									initAccountBook(form, $("#contacts"), $.parseJSON(accountBookJsonStr),data.contactIds);
									//验证
									//附加数据
									var objs = {};
									objs[ACTIONS.ORGNAME_MODIFY_UNIQUE.params.ORG_ID] = idInfo[0];
									$("#fullName").data("_jqValidate_otherObjs" , objs);
									objs[ACTIONS.ORGSHORTNAME_MODIFY_UNIQUE.params.ORG_ID] = idInfo[0];
									$("#name").data("_jqValidate_otherObjs" , objs);
									objs[ACTIONS.ORGCODE_MODIFY_UNIQUE.params.ORG_ID] = idInfo[0];
									$("#orgCode").data("_jqValidate_otherObjs" , objs);
									var validator = form.validate({
											rules: {
												"organizationDTO.orgName": {
													required: true,
													dataUnique: ACTIONS.ORGNAME_MODIFY_UNIQUE,
													maxlength: 32,
													dataName: true
												},
												"organizationDTO.orgShortName": {
													required: true,
													dataUnique: ACTIONS.ORGSHORTNAME_MODIFY_UNIQUE,
													maxlength: 32,
													dataName : true													
												},
												"organizationDTO.orgCode": {
													maxlength: 16,
													dataUnique: ACTIONS.ORGCODE_MODIFY_UNIQUE,
													dataName: true
												},
												"organizationDTO.orgPhoneNum": {
													maxlength: 32,
													orgPhoneNum: true
												},
												"organizationDTO.orgFaxNum": {
													maxlength: 32,
													orgFaxNum: true
												},
												"organizationDTO.orgMail": {
													maxlength: 64,
													email: true
												},
												"organizationDTO.orgAddress": {
													maxlength: 64,
													dataName: true
												},
												"organizationDTO.orgPostCode": {
													maxlength: 8
												},
												"organizationDTO.orgNote": {
													maxlength: 64
												}
											},
											messages: {
												"organizationDTO.orgName": {
													required: "必填项",
													dataUnique: "机构名称已存在,请重新输入",
													maxlength: "机构名称项的长度不能超过32个字符",
													dataName: "机构名称必须是中英文、数字或下划线"
												},
												"organizationDTO.orgShortName": {
													required: "必填项",
													dataUnique: "机构简称已存在,请重新输入",
													maxlength: "机构简称项的长度不能超过32个字符",
													dataName: "机构名称必须是中英文、数字或下划线"
												},
												"organizationDTO.orgCode": {
													maxlength: "机构代码项的长度不能超过16个字符",
													dataUnique: "机构代码已存在,请重新输入",
													dataName: "机构名称必须是中英文、数字或下划线"
												},
												"organizationDTO.orgPhoneNum": {
													maxlength: "机构电话号码项的长度不能超过32个字符"
												},
												"organizationDTO.orgFaxNum": {
													maxlength: "机构传真项的长度不能超过32个字符"
												},
												"organizationDTO.orgMail": {
													maxlength: "最大64个字符",
													email: "邮箱格式不正确，正确的格式为xxx@xxx.com "
												},
												"organizationDTO.orgAddress": {
													maxlength: "机构地址项的长度不能超过64个字符"
												},
												"organizationDTO.orgPostCode": {
													maxlength: "机构邮编项的长度不能超过8个字符"
												},
												"organizationDTO.orgNote": {
													maxlength: "机构备注项的长度不能超过64个字符"
												}
											},
											submitHandler : function() {
												updateAllSource();
												var $selectedContent = $(selectedContent);
												$("#orgVersion").val($selectedContent.data("source").version);
												form.ajaxSubmit({async: false, dataType: "json", success: function (data) {
														$selectedContent.find("span.node-value:first").html(form.find("#name").val());
														//更新节点源数据
														$selectedContent.data("source", data.orgDTO);
														$(getNodeById(data.orgDTO.orgId)).trigger("click");
												}});
											}
										});
									parent.find("input[type='submit']").bind("click", function (event) {
											event.stopPropagation();
										});
								});
						},
						error: function () {
							$("#contentArea").html("获取详细信息失败!");
						}
					});
			};

			function openAdd()
			{
				updateAllSource();
				var parent = $("#contentArea");
				var params = {};
				var selectedContent = tree.getSelectedContent();
				var selected = tree.getSelected();
				params.url = ACTIONS.ADD_ORG.url;
				if(selectedContent)
					params.pid = selectedContent.id.split("_")[0];
				else
				{
					params.pid = null;
				}
				params.title = "新建机构";
				oacore.UI.render("form/add_org", params, parent, function () {
						var form = $("#creatorForm");
						//初始化联系人列表
						initAccountBook(form, $("#contacts"), $.parseJSON(accountBookJsonStr),null);
						//验证
						//附加数据
						var objs = {};
						//获取父节点内容
						var parentContent = tree.getParentContent();
						var parentId = parentContent ? parseInt(parentContent.id) : "";
						objs[ACTIONS.ORGNAME_UNIQUE.params.PARENT_ORG_ID] = parentId;
						$("#fullName").data("_jqValidate_otherObjs" , objs);
						objs[ACTIONS.ORGSHORTNAME_UNIQUE.params.PARENT_ORG_ID] = parentId;
						$("#name").data("_jqValidate_otherObjs" , objs);
						objs[ACTIONS.ORGCODE_UNIQUE.params.PARENT_ORG_ID] = parentId;
						$("#orgCode").data("_jqValidate_otherObjs" , objs);
						var validator = form.validate({
								rules: {
									"organizationDTO.orgName": {
										required: true,
										dataUnique: ACTIONS.ORGNAME_UNIQUE,
										maxlength: 32,
										dataName: true
									},
									"organizationDTO.orgShortName": {
										required: true,
										dataUnique: ACTIONS.ORGSHORTNAME_UNIQUE,
										maxlength: 32,
										dataName: true
									},
									"organizationDTO.orgCode": {
										maxlength: 16,
										dataUnique: ACTIONS.ORGCODE_UNIQUE,
										dataName : true
									},
									"organizationDTO.orgPhoneNum": {
										maxlength: 32,
										orgPhoneNum: true
									},
									"organizationDTO.orgFaxNum": {
										maxlength: 32,
										orgFaxNum: true
									},
									"organizationDTO.orgMail": {
										maxlength: 64,
										email: true
									},
									"organizationDTO.orgAddress": {
										maxlength: 64,
										dataName : true
									},
									"organizationDTO.orgPostCode": {
										maxlength: 8
									},
									"organizationDTO.orgNote": {
										maxlength: 64
									}
								},
								messages: {
									"organizationDTO.orgName": {
									required: "必填项",
									dataUnique: "机构名称已存在,请重新输入",
									maxlength: "机构名称项的长度不能超过32个字符",
									dataName: "机构名称必须是中英文、数字或下划线"
								},
								"organizationDTO.orgShortName": {
									required: "必填项",
									dataUnique: "机构简称已存在,请重新输入",
									maxlength: "机构简称项的长度不能超过32个字符",
									dataName: "机构名称必须是中英文、数字或下划线"
								},
								"organizationDTO.orgCode": {
									maxlength: "机构代码项的长度不能超过16个字符",
									dataUnique: "机构代码已存在,请重新输入",
									dataName: "机构名称必须是中英文、数字或下划线"
								},
								"organizationDTO.orgPhoneNum": {
									maxlength: "机构电话号码项的长度不能超过32个字符"
								},
								"organizationDTO.orgFaxNum": {
									maxlength: "机构传真项的长度不能超过32个字符"
								},
								"organizationDTO.orgMail": {
									maxlength: "最大64个字符",
									email: "邮箱格式不正确，正确的格式为xxx@xxx.com "
								},
								"organizationDTO.orgAddress": {
									maxlength: "机构地址项的长度不能超过64个字符"
								},
								"organizationDTO.orgPostCode": {
									maxlength: "机构邮编项的长度不能超过8个字符"
								},
								"organizationDTO.orgNote": {
									maxlength: "机构备注项的长度不能超过64个字符"
								}
								},
								submitHandler : function() {
									form.ajaxSubmit({async: false, dataType: "json", success: function (data) {
											pushBeUpdateNodeData(data.organizationDTOs);
											var selectedContent = tree.getSelectedContent();
											var selected = tree.getSelected();
											var newDataSource = data.organizationDTOs[data.organizationDTOs.length - 1];
											var newData = {
														id: newDataSource.orgId,
														version: newDataSource.version,
														content: form.find("#name").val()
													};
											if(!selectedContent)
												tree.insertToRoot(newData);
											else
											{
												tree.append(newData);
											}
											$(getNodeById(newDataSource.orgId)).trigger("click");
									}});
								}
							});
						parent.find("input[type='submit']").bind("click", function (event) {
								event.stopPropagation();
							});
					});
			};

			function openAddChild(parentNodeId, newNode)
			{
				updateAllSource();
				var parent = $("#contentArea");
				var selectedContent = tree.getSelectedContent();
				var selected = tree.getSelected();
				var params = {};
				params.url = ACTIONS.ADD_CHILD_ORG.url;
				if(selectedContent)
					params.pid = selectedContent.id.split("_")[0];
				else
				{
					params.pid = null;
				}
				params.title = "新建子机构";
				oacore.UI.render("form/add_org", params, parent, function () {
						var form = $("#creatorForm");
						//初始化联系人列表
						initAccountBook(form, $("#contacts"), $.parseJSON(accountBookJsonStr),null);
						//验证
						//附加数据
						var objs = {};
						objs[ACTIONS.ORGNAME_UNIQUE.params.PARENT_ORG_ID] = params.pid == null ? '' : params.pid;
						$("#fullName").data("_jqValidate_otherObjs" , objs);
						objs[ACTIONS.ORGSHORTNAME_UNIQUE.params.PARENT_ORG_ID] = params.pid == null ? '' : params.pid;
						$("#name").data("_jqValidate_otherObjs" , objs);
						objs[ACTIONS.ORGCODE_UNIQUE.params.PARENT_ORG_ID] = params.pid == null ? '' : params.pid;
						$("#orgCode").data("_jqValidate_otherObjs" , objs);
						var validator = form.validate({
								rules: {
									"organizationDTO.orgName": {
										required: true,
										dataUnique: ACTIONS.ORGNAME_UNIQUE,
										maxlength: 32,
										dataName : true
									},
									"organizationDTO.orgShortName": {
										required: true,
										dataUnique: ACTIONS.ORGSHORTNAME_UNIQUE,
										maxlength: 32,
										dataName : true
									},
									"organizationDTO.orgCode": {
										maxlength: 16,
										dataUnique: ACTIONS.ORGCODE_UNIQUE,
										dataName : true
									},
									"organizationDTO.orgPhoneNum": {
										maxlength: 32,
										orgPhoneNum: true
									},
									"organizationDTO.orgFaxNum": {
										maxlength: 32,
										orgFaxNum: true
									},
									"organizationDTO.orgMail": {
										maxlength: 64,
										email: true
									},
									"organizationDTO.orgAddress": {
										maxlength: 64,
										dataName : true
									},
									"organizationDTO.orgPostCode": {
										maxlength: 8
									},
									"organizationDTO.orgNote": {
										maxlength: 64
									}
								},
								messages: {
									"organizationDTO.orgName": {
										required: "必填项",
										dataUnique: "机构名称已存在,请重新输入",
										maxlength: "机构名称项的长度不能超过32个字符",
										dataName: "机构名称必须是中英文、数字或下划线"
									},
									"organizationDTO.orgShortName": {
										required: "必填项",
										dataUnique: "机构简称已存在,请重新输入",
										maxlength: "机构简称项的长度不能超过32个字符",
										dataName: "机构名称必须是中英文、数字或下划线"
									},
									"organizationDTO.orgCode": {
										maxlength: "机构代码项的长度不能超过16个字符",
										dataUnique: "机构代码已存在,请重新输入",
										dataName: "机构名称必须是中英文、数字或下划线"
									},
									"organizationDTO.orgPhoneNum": {
										maxlength: "机构电话号码项的长度不能超过32个字符"
									},
									"organizationDTO.orgFaxNum": {
										maxlength: "机构传真项的长度不能超过32个字符"
									},
									"organizationDTO.orgMail": {
										maxlength: "最大64个字符",
										email: "邮箱格式不正确，正确的格式为xxx@xxx.com "
									},
									"organizationDTO.orgAddress": {
										maxlength: "机构地址项的长度不能超过64个字符"
									},
									"organizationDTO.orgPostCode": {
										maxlength: "机构邮编项的长度不能超过8个字符"
									},
									"organizationDTO.orgNote": {
										maxlength: "机构备注项的长度不能超过64个字符"
									}
								},
								submitHandler : function() {
									form.ajaxSubmit({async: false, dataType: "json", success: function (data) {
										pushBeUpdateNodeData(data.organizationDTOs);
										var newDataSource = data.organizationDTOs[data.organizationDTOs.length - 1];
										var newData = {
													id: newDataSource.orgId,
													version: newDataSource.version,
													content: form.find("#name").val()
												};
										if(!selectedContent)
											tree.appendToRoot(newData);
										else
										{
											tree.insertChild(newData);
										}
										$(getNodeById(newDataSource.orgId)).trigger("click");
									}});
								}
							});
						parent.find("input[type='submit']").bind("click", function (event) {
								event.stopPropagation();
							});
					});
			};

			$(function () {
				//生成权限树
				tree = new $.Tree({
					parent: $("#treeArea"),
					source: $.parseJSON(treeData),
					selectMode: "single",
					sourceQuote: true,
					sortable: true,
					sortover: function (node, target) {
						updateAllSource();
						var selected = node;
						if(!selected)
							return false;
						var prevNode = target;
						var params = {};
						var prevIdInfo;
						var idInfo = selected.id.split("_");
						if(!prevNode)
							prevIdInfo = [null, null];
						else
						{
							prevIdInfo = prevNode.id.split("_");
						}
						if(prevIdInfo[0])
							params[ACTIONS.MOVE_ORG.params.PREV_ORG_ID] = prevIdInfo[0];
						params[ACTIONS.MOVE_ORG.params.ORG_ID] = idInfo[0];
						$.util.Data.request({
							url: ACTIONS.MOVE_ORG.url,
							data: params,
							async: false,
							type: "post",
							success: function (data) {
								pushBeUpdateNodeData(data.organizationDTOs);
							}
						});
					},
					pretreatment: function (node) {
						var pedNode = {};
						pedNode.id = node.id += "_" + node.version + "_" + node.content;
						pedNode.content = "<span name='"+node.content+"' class='node-value'>" + node.content + "</span>";
						if(node.child && node.child.length > 0)
							pedNode.children= node.child;
						return pedNode;
					},
					onSelect: function (node) {
						openDetail(node.id);
					}
				});

				//给予事件
				$("#openAll").toggle(
							function () {
									$(this).html("全部关闭");
									tree.openAll();
								},
							function () {
									$(this).html("全部展开");
									tree.closeAll();
								}
						);
				$("#del").click(function () {
						delNode();
					});
				$("#add").click(function () {
						openAdd();
					});
				$("#add-child").click(function () {
						openAddChild();
					});
				$("#edit").click(function () {
						openEdit();
					});
				$("#moveup").click(function () {
						moveUp();
					});
				$("#movedown").click(function () {
						moveDown();
					});

				$.validator.addMethod("orgName", function (value, element) {
					if(!value||value.length <= 0)
						return true;
						return /^[\w\d_\u4e00-\u9fa5]+$/.test(value);
					}, "机构名称的格式必须为中英文、数字或下划线");

				$.validator.addMethod("orgShortName", function (value, element) {
					if(!value||value.length <= 0)
						return true;
					return /^[\d\w_\u4e00-\u9fa5]+$/.test(value);
				}, "机构简称的格式必须为中英文、数字或下划线");
				
				$.validator.addMethod("orgCode", function (value, element) {
					if(!value||value.length <= 0)
						return true;
					return /^[\d\w_\u4e00-\u9fa5]+$/.test(value);
				}, "机构代码的格式必须为中英文、数字或下划线");
				$.validator.addMethod("orgPhoneNum", function (value, element) {
					if(!value||value.length <= 0)
						return true;
					return /^[\d\+\-\(\)\）\（]+$/.test(value);
				}, '机构电话必须为数字、“+”、“-”、“（）”');
				$.validator.addMethod("orgFaxNum", function (value, element) {
					if(!value||value.length <= 0)
						return true;
					return /^[\d\+\-\(\)\（\）]+$/.test(value);
				}, '机构传真必须是数字、“+”、“-”、“（）”');
			});
		</script>
		<style type="text/css">
			div {
				position: static;
			}
			ul.jq-tree {
				margin-left: 16px;
			}
		</style>
	</head>
	<body>
		<div id="mainPage" class="surround-layout">
			<jsp:include page="../frame/top.jsp" flush="true"></jsp:include>
			<div class="middle">
				<jsp:include page="../frame/middle_left.jsp" flush="true">
					<jsp:param value="1026-1029" name="view"/>
				</jsp:include>
				<!-- 右侧输出内容 -->
				<div class="right">
					<div class="right-all-content">
						<div class="inner-dialog main">
							<h1 class="inner-dialog-title">机构管理</h1>
							<div class="inner-dialog-content">
								<table style="width: 100%;height: 100%;" cellspacing="0">
									<tbody>
										<tr>
											<td valign="top" width="30%" class="section org" style="border-right: 1px solid #A5BBD3;">
												<table class="op-part first-part" cellspacing="0" width="100px">
													<tbody>
														<tr>
															<td class="td-title">
																<table class="tree-op-group">
																	<tbody>
																		<tr>
																			<td>
																				<button class="op op-add" id="add" title="添加同级机构"></button>
																			</td>
																			<td>
																				<button class="op op-add-child" id="add-child" title="添加子机构"></button>
																			</td>
																			<td>
																				<button class="op op-moveup" id="moveup" title="上移"></button>
																			</td>
																			<td>
																				<button class="op op-movedown" id="movedown" title="下移"></button>
																			</td>
																			<td>
																				<button class="op op-del" id="del" title="删除"></button>
																			</td>
																			<td>
																				<button class="op op-edit" id="edit" title="编辑"></button>
																			</td>
																		</tr>
																	</tbody>
																</table>
															</td>
														</tr>
														<tr>
															<td>
																<div class="tree-op-2"><a href="javascript:void(0);" id="openAll">全部展开</a></div>
															</td>
														</tr>
														<tr>
															<td class="content-td">
																<div id="treeArea" class="tree-area">
																</div>
															</td>
														</tr>
													</tbody>
												</table>
											</td>
											<td valign="top" width="70%" class="section org">
												<table class="op-part last-part" cellspacing="0">
													<tbody>
														<tr>
															<td>
																
															</td>
														</tr>
														<tr>
															<td class="content-td" style="padding: 16px;">
																<div id="contentArea" class="tree-area"></div>
															</td>
														</tr>
													</tbody>
												</table>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
				<!--  -->
			</div>
		</div>
	</body>
</html>